
<%
var name = tb.pri.map(field=>under2Pascl(field.COLUMN_NAME)).join('And');
var args = tb.pri.map(field=>{
	return `@Param("${under2Camel(field.COLUMN_NAME)}") ${field.JavaType} ${under2Camel(field.COLUMN_NAME)}`;
}).join(',');
%>
	/**
	* 根据主键查询
	*/
	<%-className%> findByPrimaryKey(<%-args%>);

	/**
	* 根据主键删除
	*/
	Boolean deleteBy<%-name%>(<%-args%>);
<%
tb.uni.forEach(field=>{
%>
	
	/**
	* 根据唯一索引查询
	*/
	<%-className%> findBy<%-under2Pascl(field.COLUMN_NAME)%>(@Param("<%-under2Camel(field.COLUMN_NAME)%>") <%-field.JavaType%> <%-under2Camel(field.COLUMN_NAME)%>);

	/**
	* 根据唯一索引删除
	*/
	Boolean deleteBy<%-under2Pascl(field.COLUMN_NAME)%>(@Param("<%-under2Camel(field.COLUMN_NAME)%>") <%-field.JavaType%> <%-under2Camel(field.COLUMN_NAME)%>);
<%
});
%>

<% // 外健需要做查询 有时候外健同时是唯一索引，这里的方法名会重复，因此报错。记得在Mapper中也要删除同名的select
tb.fields.filter(field=>field.REFERENCED)
.forEach(field=>{
%>
	/**
	* 根据外健查询,方便<%-field.REFERENCED.TABLE_NAME%>=><%-field.REFERENCED.COLUMN_NAME%>表做一对多
	*/
	List<<%-className%>> findBy<%-under2Pascl(field.COLUMN_NAME)%>(@Param("<%-under2Camel(field.COLUMN_NAME)%>") <%-field.JavaType%> <%-under2Camel(field.COLUMN_NAME)%>);
<%
});
%>
